import request from '@/utils/request';

//查询区域
export function queryArea(section_id) {
    return request({
        url: `/area/?section_id=${section_id}`,
        method: 'get',
    })
}

//查看区域列表（分页版）
export function queryAreaPage(data) {
    return request({
        url: `/area/area_list/`,
        method: 'get',
        params:{
            page:data.page.pageNum,
            size:data.page.pageSize,
        }
    })
}

//创建区域
export function createArea(data) {
    return request({
        url: '/area/',
        method: 'post',
        data: data
    })
}

//修改区域
export function updateArea(data) {
    return request({
        url: `/area/${data.id}/`,
        method: 'put',
        data: data
    })
}

//删除区域
export function delArea(id) {
    return request({
        url: `/area/${id}`,
        method: 'delete',
    })
}
